Skip to content

gomodjail: update to v2.0.1, enforce static analysis in CI - #5192

Merged
ChengyuZhu6 merged 1 commit into
containerd:mainfrom
AkihiroSuda:gomodjail
Sep 10, 2026
Merged

ChengyuZhu6 merged 1 commit into
containerd:mainfrom
AkihiroSuda:gomodjail

Conversation

@AkihiroSuda

@AkihiroSuda AkihiroSuda commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

gomodjail v2 moves the focus from the dynamic (seccomp) mode to a static analysis gate: gomodjail analyze fails if a module annotated gomodjail:confined in go.mod can reach a denied capability (filesystem, network, process execution, raw syscalls, OS state modification, or cgo).

  • Dockerfile: bump GOMODJAIL_VERSION to v2.0.1. gomodjail pack is unchanged in v2, so the packed nerdctl.gomodjail binary (dynamic mode) keeps working as before.
  • Makefile: add lint-gomodjail / lint-gomodjail-all (part of make lint) and fix-gomodjail (part of make fix), and install gomodjail in install-dev-tools. The gate is only enforced for linux/amd64 and linux/arm64: these are the only platforms the packed binary is built for, and the only ones the dynamic mode supports. The verdicts are platform-dependent, hence both architectures are analyzed.
  • CI: add the gomodjail job to the lint workflow.
  • go.mod: gomodjail fix downgraded the annotation of the 39 modules that fail the gate to gomodjail:unconfined, so that the decision stays visible and reviewable. 57 modules remain confined (24 ok, 33 warnings, 0 violations). The inline annotations are also reformatted to // gomodjail:..., the style gomodjail fix writes, so that future fixes do not leave go.mod in two styles.

@AkihiroSuda AkihiroSuda added this to the v2.4.0 milestone Sep 8, 2026
@AkihiroSuda
AkihiroSuda force-pushed the gomodjail branch 3 times, most recently from dd7e775 to 6d22d15 Compare September 8, 2026 21:00
@AkihiroSuda
AkihiroSuda marked this pull request as ready for review September 8, 2026 21:00
@AkihiroSuda
AkihiroSuda requested a review from ktock September 8, 2026 21:30
Comment thread go.mod Resolved
@AkihiroSuda
AkihiroSuda marked this pull request as draft September 9, 2026 02:53
@AkihiroSuda
AkihiroSuda force-pushed the gomodjail branch 2 times, most recently from 8b3f709 to 542fae6 Compare September 9, 2026 03:28
@AkihiroSuda AkihiroSuda changed the title gomodjail: update to v2.0.0, enforce static analysis in CI gomodjail: update to v2.0.1, enforce static analysis in CI Sep 9, 2026
@AkihiroSuda
AkihiroSuda marked this pull request as ready for review September 9, 2026 03:29
gomodjail v2 moves the focus from the dynamic (seccomp) mode to a static
analysis gate: `gomodjail analyze` fails if a module annotated
`gomodjail:confined` in go.mod can reach a denied capability (filesystem,
network, process execution, raw syscalls, OS state modification, or cgo).

- Dockerfile: bump GOMODJAIL_VERSION to v2.0.1. `gomodjail pack`
  is unchanged in v2, so the packed `nerdctl.gomodjail` binary (dynamic
  mode) keeps working as before.
- Makefile: add `lint-gomodjail` / `lint-gomodjail-all` (part of
  `make lint`) and `fix-gomodjail` (part of `make fix`), and install
  gomodjail in `install-dev-tools`. The gate is only enforced for
  linux/amd64 and linux/arm64: these are the only platforms the packed
  binary is built for, and the only ones the dynamic mode supports.
  The verdicts are platform-dependent, hence both architectures are
  analyzed.
- CI: add the `gomodjail` job to the lint workflow.
- go.mod: `gomodjail fix` downgraded the annotation of the 39 modules
  that fail the gate to `gomodjail:unconfined`, so that the decision
  stays visible and reviewable. 57 modules remain confined
  (24 ok, 33 warnings, 0 violations). The inline annotations are also
  reformatted to `// gomodjail:...`, the style `gomodjail fix` writes,
  so that future fixes do not leave go.mod in two styles.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>

@ChengyuZhu6 ChengyuZhu6 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ChengyuZhu6
ChengyuZhu6 merged commit ed192dc into containerd:main Sep 10, 2026
65 of 69 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants